package router

import (
	"github.com/gin-gonic/gin"
	"loveserver/handler"
)

func loadAdvice(v1 *gin.RouterGroup){

	v1.Use()
	{
		v1.GET("/advices/", handler.FetchAllAdvice)			// get /advices => 获取所有意见
		v1.GET("/advices/:id", handler.FetchSingleAdvice)		// get /advices/:id => 根据id获取意见
		v1.POST("/advices", handler.AddAdvice)				// post /advices => 添加意见
		v1.POST("/advicesMail", handler.HandleAdvice)			//post /advices/ => 向意见发送者通过邮箱给出反馈
		v1.DELETE("/advices/:id", handler.DeleteAdvice)		// delete /advices/:id => 根据id删除意见
	}

}